3.366 \(\int \frac {\cot (e+f x)}{(a+b \sec ^2(e+f x))^3} \, dx\)

Optimal. Leaf size=130 \[ -\frac {b^3}{4 a^3 f (a+b) \left (a \cos ^2(e+f x)+b\right )^2}+\frac {b^2 (3 a+2 b)}{2 a^3 f (a+b)^2 \left (a \cos ^2(e+f x)+b\right )}+\frac {b \left (3 a^2+3 a b+b^2\right ) \log \left (a \cos ^2(e+f x)+b\right )}{2 a^3 f (a+b)^3}+\frac {\log (\sin (e+f x))}{f (a+b)^3} \]

[Out]

-1/4*b^3/a^3/(a+b)/f/(b+a*cos(f*x+e)^2)^2+1/2*b^2*(3*a+2*b)/a^3/(a+b)^2/f/(b+a*cos(f*x+e)^2)+1/2*b*(3*a^2+3*a*
b+b^2)*ln(b+a*cos(f*x+e)^2)/a^3/(a+b)^3/f+ln(sin(f*x+e))/(a+b)^3/f

________________________________________________________________________________________

Rubi [A]  time = 0.17, antiderivative size = 130, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {4138, 446, 88} \[ -\frac {b^3}{4 a^3 f (a+b) \left (a \cos ^2(e+f x)+b\right )^2}+\frac {b^2 (3 a+2 b)}{2 a^3 f (a+b)^2 \left (a \cos ^2(e+f x)+b\right )}+\frac {b \left (3 a^2+3 a b+b^2\right ) \log \left (a \cos ^2(e+f x)+b\right )}{2 a^3 f (a+b)^3}+\frac {\log (\sin (e+f x))}{f (a+b)^3} \]

Antiderivative was successfully verified.

[In]

Int[Cot[e + f*x]/(a + b*Sec[e + f*x]^2)^3,x]

[Out]

-b^3/(4*a^3*(a + b)*f*(b + a*Cos[e + f*x]^2)^2) + (b^2*(3*a + 2*b))/(2*a^3*(a + b)^2*f*(b + a*Cos[e + f*x]^2))
 + (b*(3*a^2 + 3*a*b + b^2)*Log[b + a*Cos[e + f*x]^2])/(2*a^3*(a + b)^3*f) + Log[Sin[e + f*x]]/((a + b)^3*f)

Rule 88

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Int[ExpandI
ntegrand[(a + b*x)^m*(c + d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, c, d, e, f, p}, x] && IntegersQ[m, n] &&
(IntegerQ[p] || (GtQ[m, 0] && GeQ[n, -1]))

Rule 446

Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_))^(q_.), x_Symbol] :> Dist[1/n, Subst[Int
[x^(Simplify[(m + 1)/n] - 1)*(a + b*x)^p*(c + d*x)^q, x], x, x^n], x] /; FreeQ[{a, b, c, d, m, n, p, q}, x] &&
 NeQ[b*c - a*d, 0] && IntegerQ[Simplify[(m + 1)/n]]

Rule 4138

Int[((a_) + (b_.)*sec[(e_.) + (f_.)*(x_)]^(n_))^(p_.)*tan[(e_.) + (f_.)*(x_)]^(m_.), x_Symbol] :> Module[{ff =
 FreeFactors[Cos[e + f*x], x]}, -Dist[(f*ff^(m + n*p - 1))^(-1), Subst[Int[((1 - ff^2*x^2)^((m - 1)/2)*(b + a*
(ff*x)^n)^p)/x^(m + n*p), x], x, Cos[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f, n}, x] && IntegerQ[(m - 1)/2] &&
IntegerQ[n] && IntegerQ[p]

Rubi steps

\begin {align*} \int \frac {\cot (e+f x)}{\left (a+b \sec ^2(e+f x)\right )^3} \, dx &=-\frac {\operatorname {Subst}\left (\int \frac {x^7}{\left (1-x^2\right ) \left (b+a x^2\right )^3} \, dx,x,\cos (e+f x)\right )}{f}\\ &=-\frac {\operatorname {Subst}\left (\int \frac {x^3}{(1-x) (b+a x)^3} \, dx,x,\cos ^2(e+f x)\right )}{2 f}\\ &=-\frac {\operatorname {Subst}\left (\int \left (-\frac {1}{(a+b)^3 (-1+x)}-\frac {b^3}{a^2 (a+b) (b+a x)^3}+\frac {b^2 (3 a+2 b)}{a^2 (a+b)^2 (b+a x)^2}-\frac {b \left (3 a^2+3 a b+b^2\right )}{a^2 (a+b)^3 (b+a x)}\right ) \, dx,x,\cos ^2(e+f x)\right )}{2 f}\\ &=-\frac {b^3}{4 a^3 (a+b) f \left (b+a \cos ^2(e+f x)\right )^2}+\frac {b^2 (3 a+2 b)}{2 a^3 (a+b)^2 f \left (b+a \cos ^2(e+f x)\right )}+\frac {b \left (3 a^2+3 a b+b^2\right ) \log \left (b+a \cos ^2(e+f x)\right )}{2 a^3 (a+b)^3 f}+\frac {\log (\sin (e+f x))}{(a+b)^3 f}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 1.00, size = 158, normalized size = 1.22 \[ \frac {\sec ^6(e+f x) (a \cos (2 (e+f x))+a+2 b)^3 \left (-\frac {b^3 (a+b)^2}{a^3 \left (-a \sin ^2(e+f x)+a+b\right )^2}+\frac {2 b^2 (a+b) (3 a+2 b)}{a^3 \left (-a \sin ^2(e+f x)+a+b\right )}+\frac {2 b \left (3 a^2+3 a b+b^2\right ) \log \left (-a \sin ^2(e+f x)+a+b\right )}{a^3}+4 \log (\sin (e+f x))\right )}{32 f (a+b)^3 \left (a+b \sec ^2(e+f x)\right )^3} \]

Antiderivative was successfully verified.

[In]

Integrate[Cot[e + f*x]/(a + b*Sec[e + f*x]^2)^3,x]

[Out]

((a + 2*b + a*Cos[2*(e + f*x)])^3*Sec[e + f*x]^6*(4*Log[Sin[e + f*x]] + (2*b*(3*a^2 + 3*a*b + b^2)*Log[a + b -
 a*Sin[e + f*x]^2])/a^3 - (b^3*(a + b)^2)/(a^3*(a + b - a*Sin[e + f*x]^2)^2) + (2*b^2*(a + b)*(3*a + 2*b))/(a^
3*(a + b - a*Sin[e + f*x]^2))))/(32*(a + b)^3*f*(a + b*Sec[e + f*x]^2)^3)

________________________________________________________________________________________

fricas [B]  time = 1.07, size = 307, normalized size = 2.36 \[ \frac {5 \, a^{2} b^{3} + 8 \, a b^{4} + 3 \, b^{5} + 2 \, {\left (3 \, a^{3} b^{2} + 5 \, a^{2} b^{3} + 2 \, a b^{4}\right )} \cos \left (f x + e\right )^{2} + 2 \, {\left (3 \, a^{2} b^{3} + 3 \, a b^{4} + b^{5} + {\left (3 \, a^{4} b + 3 \, a^{3} b^{2} + a^{2} b^{3}\right )} \cos \left (f x + e\right )^{4} + 2 \, {\left (3 \, a^{3} b^{2} + 3 \, a^{2} b^{3} + a b^{4}\right )} \cos \left (f x + e\right )^{2}\right )} \log \left (a \cos \left (f x + e\right )^{2} + b\right ) + 4 \, {\left (a^{5} \cos \left (f x + e\right )^{4} + 2 \, a^{4} b \cos \left (f x + e\right )^{2} + a^{3} b^{2}\right )} \log \left (\frac {1}{2} \, \sin \left (f x + e\right )\right )}{4 \, {\left ({\left (a^{8} + 3 \, a^{7} b + 3 \, a^{6} b^{2} + a^{5} b^{3}\right )} f \cos \left (f x + e\right )^{4} + 2 \, {\left (a^{7} b + 3 \, a^{6} b^{2} + 3 \, a^{5} b^{3} + a^{4} b^{4}\right )} f \cos \left (f x + e\right )^{2} + {\left (a^{6} b^{2} + 3 \, a^{5} b^{3} + 3 \, a^{4} b^{4} + a^{3} b^{5}\right )} f\right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)/(a+b*sec(f*x+e)^2)^3,x, algorithm="fricas")

[Out]

1/4*(5*a^2*b^3 + 8*a*b^4 + 3*b^5 + 2*(3*a^3*b^2 + 5*a^2*b^3 + 2*a*b^4)*cos(f*x + e)^2 + 2*(3*a^2*b^3 + 3*a*b^4
 + b^5 + (3*a^4*b + 3*a^3*b^2 + a^2*b^3)*cos(f*x + e)^4 + 2*(3*a^3*b^2 + 3*a^2*b^3 + a*b^4)*cos(f*x + e)^2)*lo
g(a*cos(f*x + e)^2 + b) + 4*(a^5*cos(f*x + e)^4 + 2*a^4*b*cos(f*x + e)^2 + a^3*b^2)*log(1/2*sin(f*x + e)))/((a
^8 + 3*a^7*b + 3*a^6*b^2 + a^5*b^3)*f*cos(f*x + e)^4 + 2*(a^7*b + 3*a^6*b^2 + 3*a^5*b^3 + a^4*b^4)*f*cos(f*x +
 e)^2 + (a^6*b^2 + 3*a^5*b^3 + 3*a^4*b^4 + a^3*b^5)*f)

________________________________________________________________________________________

giac [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: NotImplementedError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)/(a+b*sec(f*x+e)^2)^3,x, algorithm="giac")

[Out]

Exception raised: NotImplementedError >> Unable to parse Giac output: Unable to check sign: (2*pi/x/2)>(-2*pi/
x/2)Unable to check sign: (2*pi/x/2)>(-2*pi/x/2)Unable to check sign: (2*pi/x/2)>(-2*pi/x/2)2/f*(1/(4*a^3+12*a
^2*b+12*a*b^2+4*b^3)*ln(abs(1-cos(f*x+exp(1)))/abs(1+cos(f*x+exp(1))))-1/2/a^3*ln(abs((1-cos(f*x+exp(1)))/(1+c
os(f*x+exp(1)))+1))+(3*a^2*b+3*a*b^2+b^3)/(4*a^6+12*a^5*b+12*a^4*b^2+4*a^3*b^3)*ln(((1-cos(f*x+exp(1)))/(1+cos
(f*x+exp(1))))^2*a+((1-cos(f*x+exp(1)))/(1+cos(f*x+exp(1))))^2*b-2*(1-cos(f*x+exp(1)))/(1+cos(f*x+exp(1)))*a+2
*(1-cos(f*x+exp(1)))/(1+cos(f*x+exp(1)))*b+a+b)+(-9*((1-cos(f*x+exp(1)))/(1+cos(f*x+exp(1))))^4*a^3*b-18*((1-c
os(f*x+exp(1)))/(1+cos(f*x+exp(1))))^4*a^2*b^2-12*((1-cos(f*x+exp(1)))/(1+cos(f*x+exp(1))))^4*a*b^3-3*((1-cos(
f*x+exp(1)))/(1+cos(f*x+exp(1))))^4*b^4+36*((1-cos(f*x+exp(1)))/(1+cos(f*x+exp(1))))^3*a^3*b+24*((1-cos(f*x+ex
p(1)))/(1+cos(f*x+exp(1))))^3*a^2*b^2-16*((1-cos(f*x+exp(1)))/(1+cos(f*x+exp(1))))^3*a*b^3-12*((1-cos(f*x+exp(
1)))/(1+cos(f*x+exp(1))))^3*b^4-54*((1-cos(f*x+exp(1)))/(1+cos(f*x+exp(1))))^2*a^3*b-12*((1-cos(f*x+exp(1)))/(
1+cos(f*x+exp(1))))^2*a^2*b^2-8*((1-cos(f*x+exp(1)))/(1+cos(f*x+exp(1))))^2*a*b^3-18*((1-cos(f*x+exp(1)))/(1+c
os(f*x+exp(1))))^2*b^4+36*(1-cos(f*x+exp(1)))/(1+cos(f*x+exp(1)))*a^3*b+24*(1-cos(f*x+exp(1)))/(1+cos(f*x+exp(
1)))*a^2*b^2-16*(1-cos(f*x+exp(1)))/(1+cos(f*x+exp(1)))*a*b^3-12*(1-cos(f*x+exp(1)))/(1+cos(f*x+exp(1)))*b^4-9
*a^3*b-18*a^2*b^2-12*a*b^3-3*b^4)/(8*a^5+16*a^4*b+8*a^3*b^2)/(((1-cos(f*x+exp(1)))/(1+cos(f*x+exp(1))))^2*a+((
1-cos(f*x+exp(1)))/(1+cos(f*x+exp(1))))^2*b-2*(1-cos(f*x+exp(1)))/(1+cos(f*x+exp(1)))*a+2*(1-cos(f*x+exp(1)))/
(1+cos(f*x+exp(1)))*b+a+b)^2)

________________________________________________________________________________________

maple [B]  time = 1.07, size = 304, normalized size = 2.34 \[ -\frac {b^{3}}{4 f \left (a +b \right )^{3} a \left (b +a \left (\cos ^{2}\left (f x +e \right )\right )\right )^{2}}-\frac {b^{4}}{2 f \left (a +b \right )^{3} a^{2} \left (b +a \left (\cos ^{2}\left (f x +e \right )\right )\right )^{2}}-\frac {b^{5}}{4 a^{3} \left (a +b \right )^{3} f \left (b +a \left (\cos ^{2}\left (f x +e \right )\right )\right )^{2}}+\frac {3 b \ln \left (b +a \left (\cos ^{2}\left (f x +e \right )\right )\right )}{2 f \left (a +b \right )^{3} a}+\frac {3 b^{2} \ln \left (b +a \left (\cos ^{2}\left (f x +e \right )\right )\right )}{2 f \left (a +b \right )^{3} a^{2}}+\frac {b^{3} \ln \left (b +a \left (\cos ^{2}\left (f x +e \right )\right )\right )}{2 f \left (a +b \right )^{3} a^{3}}+\frac {3 b^{2}}{2 f \left (a +b \right )^{3} a \left (b +a \left (\cos ^{2}\left (f x +e \right )\right )\right )}+\frac {5 b^{3}}{2 f \left (a +b \right )^{3} a^{2} \left (b +a \left (\cos ^{2}\left (f x +e \right )\right )\right )}+\frac {b^{4}}{f \left (a +b \right )^{3} a^{3} \left (b +a \left (\cos ^{2}\left (f x +e \right )\right )\right )}+\frac {\ln \left (-1+\cos \left (f x +e \right )\right )}{2 f \left (a +b \right )^{3}}+\frac {\ln \left (1+\cos \left (f x +e \right )\right )}{2 f \left (a +b \right )^{3}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(f*x+e)/(a+b*sec(f*x+e)^2)^3,x)

[Out]

-1/4/f*b^3/(a+b)^3/a/(b+a*cos(f*x+e)^2)^2-1/2/f*b^4/(a+b)^3/a^2/(b+a*cos(f*x+e)^2)^2-1/4*b^5/a^3/(a+b)^3/f/(b+
a*cos(f*x+e)^2)^2+3/2/f*b/(a+b)^3/a*ln(b+a*cos(f*x+e)^2)+3/2/f*b^2/(a+b)^3/a^2*ln(b+a*cos(f*x+e)^2)+1/2/f*b^3/
(a+b)^3/a^3*ln(b+a*cos(f*x+e)^2)+3/2/f*b^2/(a+b)^3/a/(b+a*cos(f*x+e)^2)+5/2/f*b^3/(a+b)^3/a^2/(b+a*cos(f*x+e)^
2)+1/f*b^4/(a+b)^3/a^3/(b+a*cos(f*x+e)^2)+1/2/f/(a+b)^3*ln(-1+cos(f*x+e))+1/2/f/(a+b)^3*ln(1+cos(f*x+e))

________________________________________________________________________________________

maxima [A]  time = 0.37, size = 243, normalized size = 1.87 \[ \frac {\frac {2 \, {\left (3 \, a^{2} b + 3 \, a b^{2} + b^{3}\right )} \log \left (a \sin \left (f x + e\right )^{2} - a - b\right )}{a^{6} + 3 \, a^{5} b + 3 \, a^{4} b^{2} + a^{3} b^{3}} + \frac {6 \, a^{2} b^{2} + 9 \, a b^{3} + 3 \, b^{4} - 2 \, {\left (3 \, a^{2} b^{2} + 2 \, a b^{3}\right )} \sin \left (f x + e\right )^{2}}{a^{7} + 4 \, a^{6} b + 6 \, a^{5} b^{2} + 4 \, a^{4} b^{3} + a^{3} b^{4} + {\left (a^{7} + 2 \, a^{6} b + a^{5} b^{2}\right )} \sin \left (f x + e\right )^{4} - 2 \, {\left (a^{7} + 3 \, a^{6} b + 3 \, a^{5} b^{2} + a^{4} b^{3}\right )} \sin \left (f x + e\right )^{2}} + \frac {2 \, \log \left (\sin \left (f x + e\right )^{2}\right )}{a^{3} + 3 \, a^{2} b + 3 \, a b^{2} + b^{3}}}{4 \, f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)/(a+b*sec(f*x+e)^2)^3,x, algorithm="maxima")

[Out]

1/4*(2*(3*a^2*b + 3*a*b^2 + b^3)*log(a*sin(f*x + e)^2 - a - b)/(a^6 + 3*a^5*b + 3*a^4*b^2 + a^3*b^3) + (6*a^2*
b^2 + 9*a*b^3 + 3*b^4 - 2*(3*a^2*b^2 + 2*a*b^3)*sin(f*x + e)^2)/(a^7 + 4*a^6*b + 6*a^5*b^2 + 4*a^4*b^3 + a^3*b
^4 + (a^7 + 2*a^6*b + a^5*b^2)*sin(f*x + e)^4 - 2*(a^7 + 3*a^6*b + 3*a^5*b^2 + a^4*b^3)*sin(f*x + e)^2) + 2*lo
g(sin(f*x + e)^2)/(a^3 + 3*a^2*b + 3*a*b^2 + b^3))/f

________________________________________________________________________________________

mupad [B]  time = 4.86, size = 190, normalized size = 1.46 \[ \frac {\ln \left (\mathrm {tan}\left (e+f\,x\right )\right )}{f\,\left (a^3+3\,a^2\,b+3\,a\,b^2+b^3\right )}-\frac {\frac {2\,b^2+5\,a\,b}{4\,a^2\,\left (a+b\right )}+\frac {b\,{\mathrm {tan}\left (e+f\,x\right )}^2\,\left (b^2+2\,a\,b\right )}{2\,a^2\,{\left (a+b\right )}^2}}{f\,\left (2\,a\,b+a^2+b^2+{\mathrm {tan}\left (e+f\,x\right )}^2\,\left (2\,b^2+2\,a\,b\right )+b^2\,{\mathrm {tan}\left (e+f\,x\right )}^4\right )}-\frac {\ln \left ({\mathrm {tan}\left (e+f\,x\right )}^2+1\right )}{2\,a^3\,f}+\frac {b\,\ln \left (b\,{\mathrm {tan}\left (e+f\,x\right )}^2+a+b\right )\,\left (3\,a^2+3\,a\,b+b^2\right )}{2\,a^3\,f\,{\left (a+b\right )}^3} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(e + f*x)/(a + b/cos(e + f*x)^2)^3,x)

[Out]

log(tan(e + f*x))/(f*(3*a*b^2 + 3*a^2*b + a^3 + b^3)) - ((5*a*b + 2*b^2)/(4*a^2*(a + b)) + (b*tan(e + f*x)^2*(
2*a*b + b^2))/(2*a^2*(a + b)^2))/(f*(2*a*b + a^2 + b^2 + tan(e + f*x)^2*(2*a*b + 2*b^2) + b^2*tan(e + f*x)^4))
 - log(tan(e + f*x)^2 + 1)/(2*a^3*f) + (b*log(a + b + b*tan(e + f*x)^2)*(3*a*b + 3*a^2 + b^2))/(2*a^3*f*(a + b
)^3)

________________________________________________________________________________________

sympy [F(-1)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(f*x+e)/(a+b*sec(f*x+e)**2)**3,x)

[Out]

Timed out

________________________________________________________________________________________